Telegram Group & Telegram Channel
🐍 Задача про умножение матриц

Условие: Вам даны две матрицы, нужно написать функцию для их умножения. Матрицы могут быть квадратными или прямоугольными.

Решение: Напишем решение на чистом Python
def matrix_multiply(A, B):
# Сначала проверим, можем ли мы вообще перемножить эти матрицы
if len(A[0]) != len(B):
raise ValueError("Number of A columns must equal number of B rows.")

# Инициализируем результирующую матрицу, заполненную нулями
result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]

# Перемножим матрицы
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]

return result

# Проверим функцию на примере
A = [[1, 2, 3],
[4, 5, 6]]

B = [[7, 8],
[9, 10],
[11, 12]]

result = matrix_multiply(A, B)
for row in result:
print(row)


#программирование
#линейная_алгебра



tg-me.com/ds_interview_lib/268
Create:
Last Update:

🐍 Задача про умножение матриц

Условие: Вам даны две матрицы, нужно написать функцию для их умножения. Матрицы могут быть квадратными или прямоугольными.

Решение: Напишем решение на чистом Python

def matrix_multiply(A, B):
# Сначала проверим, можем ли мы вообще перемножить эти матрицы
if len(A[0]) != len(B):
raise ValueError("Number of A columns must equal number of B rows.")

# Инициализируем результирующую матрицу, заполненную нулями
result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]

# Перемножим матрицы
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]

return result

# Проверим функцию на примере
A = [[1, 2, 3],
[4, 5, 6]]

B = [[7, 8],
[9, 10],
[11, 12]]

result = matrix_multiply(A, B)
for row in result:
print(row)


#программирование
#линейная_алгебра

BY Библиотека собеса по Data Science | вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/ds_interview_lib/268

View MORE
Open in Telegram


Библиотека собеса по Data Science | вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

How to Buy Bitcoin?

Most people buy Bitcoin via exchanges, such as Coinbase. Exchanges allow you to buy, sell and hold cryptocurrency, and setting up an account is similar to opening a brokerage account—you’ll need to verify your identity and provide some kind of funding source, such as a bank account or debit card. Major exchanges include Coinbase, Kraken, and Gemini. You can also buy Bitcoin at a broker like Robinhood. Regardless of where you buy your Bitcoin, you’ll need a digital wallet in which to store it. This might be what’s called a hot wallet or a cold wallet. A hot wallet (also called an online wallet) is stored by an exchange or a provider in the cloud. Providers of online wallets include Exodus, Electrum and Mycelium. A cold wallet (or mobile wallet) is an offline device used to store Bitcoin and is not connected to the Internet. Some mobile wallet options include Trezor and Ledger.

Telegram auto-delete message, expiring invites, and more

elegram is updating its messaging app with options for auto-deleting messages, expiring invite links, and new unlimited groups, the company shared in a blog post. Much like Signal, Telegram received a burst of new users in the confusion over WhatsApp’s privacy policy and now the company is adopting features that were already part of its competitors’ apps, features which offer more security and privacy. Auto-deleting messages were already possible in Telegram’s encrypted Secret Chats, but this new update for iOS and Android adds the option to make messages disappear in any kind of chat. Auto-delete can be enabled inside of chats, and set to delete either 24 hours or seven days after messages are sent. Auto-delete won’t remove every message though; if a message was sent before the feature was turned on, it’ll stick around. Telegram’s competitors have had similar features: WhatsApp introduced a feature in 2020 and Signal has had disappearing messages since at least 2016.

Библиотека собеса по Data Science | вопросы с собеседований from jp


Telegram Библиотека собеса по Data Science | вопросы с собеседований
FROM USA